<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>等分布局的第二种解决方法</title>
  <style>
    #parent {
      width: 100%;
      /* <table> */
      display: table;
    }

    .col1,
    .col2,
    .col3,
    .col4 {
      height: 300px;
      /* <td> */
      display: table-cell;
    }

    .col1 {
      background-color: hotpink;
    }

    .col2 {
      background-color: lightblue;
    }

    .col3 {
      background-color: green;
    }

    .col4 {
      background-color: yellow;
    }
  </style>
</head>

<body>
  <!-- 作为父级容器 -->
  <div id="parent">
    <div class="col1"></div>
    <div class="col2"></div>
    <div class="col3"></div>
    <div class="col4"></div>
  </div>
</body>

</html>